/**
 * Created by vincent on 2017/9/28.
 */
moduleQuiz.controller('EditQuizTopic', function ($$CambioConfig, $scope, $log, LoadingService, DialogService, EnumService) {
    initPage($scope);
    $scope.$on("ngDialog.opened", function () {
        dialogOnLoad();
        $scope.gaugeTopicTypeOptions = Enums.GaugeTopicTypeEnum.options;
    });

    $scope.cancel = function () {
        DialogService.close();
    };

    $scope.submit = function () {
        if ($scope.editGTForm.$valid) {
            $scope.editingTopic.type = EnumService.getEnumKey($scope.editingTopic.typeOption);
            angular.copy($scope.editingTopic, $scope.currentTopic);
            DialogService.close();
        }
    };

});